package com.good.child.ui.activity.constants.update;

import android.content.Context;

/**
 * Create on: 2024/8/4
 * by Mr.Zhu
 * Description: TODO
 */
public abstract class IUpdateDownload {
    private DownloadCallback callback;

    public IUpdateDownload(DownloadCallback callback) {
        this.callback = callback;
    }

    public DownloadCallback getCallback() {
        return callback;
    }

    public static IUpdateDownload download(Context context, String url, String name, DownloadCallback callback) {
//        if (RePluginSupport.BuildConfig.isPro()) {
        return new DownloadUtils(context, url, name,callback);
//        }
//        return new DownloadUtils2(context, url, name, callback);
    }


    public abstract void reInstall();

    public void onDestroy(){
        callback = null;
    }

    public interface DownloadCallback {
        void onDownloading(int present);

        void onDownloadFail();
    }
}
